package com.xiaolin.dao;

import com.xiaolin.pojo.MessageContext;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author XiaoLin
 * @date 2019/2/25 10:35
 */
@org.apache.ibatis.annotations.Mapper
public interface MessageContextMapper extends Mapper<MessageContext> {

    @Select("select * from message_context where mid=#{mid} ORDER BY send_date asc")
    @Results({
            @Result(property = "mcId", column = "mc_id"),
            @Result(property = "text", column = "text"),
            @Result(property = "viewState", column = "view_state"),
            @Result(property = "mcType", column = "mc_type"),
            @Result(property = "sendDate", column = "send_date"),
            @Result(property = "sendUid", column = "send_uid"),
            @Result(property = "mid", column = "mid"),
    })
    List<MessageContext> findByMid(Integer mid);
}
